@extends('admin.base')
@section('css')
<style>
	.media img{
		height: 150px;
		width: 150px;
	}
	.media-heading{
		padding-bottom: 1em;
	}
	.media-heading>a{
		color:#333;
	}
	.media-heading>a:hover{
		color:#df7366;
		text-decoration: none;		
	}
</style>
@endsection
@section('title','Articles')
@section('content')
<div>
<a class="btn btn-primary" href="{{ URL('siteadmin/article/create')}}">
	Create
</a>
</div>
<hr/>
<div>
@foreach($articles as $article)
<div class="media">
	<div class="media-left">
	   <a href="{{ URL('siteadmin/article/'.$article->id.'/edit')}}">
	      <img class="media-object" src="{{ asset($article->cover_url)}}" 
	      alt="媒体对象">
	   </a>
   </div>
   <div class="media-body">
      <h4 class="media-heading">
      <a href="{{ URL('siteadmin/article/'.$article->id.'/edit')}}" class="title">
      	<strong>{{ $article->title}}</strong>
      	</a>
  	  </h4>
  	  <h5 class="media-body">
  	  	<?php echo "$article->content_cut" ?>
  	  </h5>  	 
   </div>
   <div class="media-bottom"> 	  	
  	  	<form action="{{ URL('siteadmin/article/'.$article->id )}}" method="post" class="pull-right">
  	  		<input type="hidden" name="_method" value="DELETE" />
  	  		<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
  	  		<a href="{{ URL('siteadmin/article/'.$article->id.'/edit')}}" class="btn btn-success">Edit</a>
  	  		<button type="submit" class="btn btn-danger">Delete</button>
  	  	</form>
  	  </div> 
</div>
@endforeach
{!!$articles->render() !!}
</div>
@endsection
